package com.yinghuo.risk.frigate.web.entity;

import com.yinghuo.risk.frigate.core.info.UserLoginInfo;

import javax.persistence.*;
import java.util.List;
import java.util.Objects;
import java.util.Set;

/**
 * com.yinghuo.risk.frigate.core.entity
 *
 * @author 白雨浓
 * date: 2018/10/17 9:49
 * content:
 */
@Entity
@Table(name = "user_info", schema = "shiro-test", catalog = "")
public class UserInfoEntity implements UserLoginInfo {
    private int id;
    private String realName;
    private String password;

    @Id
    @Column(name = "id")
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "real_name")
    public String getRealName() {
        return realName;
    }

    public void setRealName(String realName) {
        this.realName = realName;
    }

    @Basic
    @Column(name = "password")
    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        UserInfoEntity that = (UserInfoEntity) o;
        return id == that.id &&
                Objects.equals(realName, that.realName) &&
                Objects.equals(password, that.password);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, realName, password);
    }

    @Override
    public Set<String> roleSet() {
        return null;
    }

    @Override
    public Set<String> permissionSet() {
        return null;
    }
}
